package com.azusa.xbiao.dao;

import com.azusa.xbiao.entity.Order;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface OrderDao extends JpaRepository<Order,Integer> {

    @Query("from Order where uId=?1 and arrival=?2 order by createDate desc")
    List<Order> findByUIdAndArrival(int uid,byte arrival);

    @Query("from Order where uId=?1 and arrival=?2 and evaluate=0 order by arrivalDate desc")
    List<Order> findEvaluateOrder(int uid,byte arrival);
}
